package com.demo.datastructure.recursion;

/**
 * @author ljr
 * @version 1.0
 * @description: 递归实现阶乘
 * @date 2021/10/13 10:45
 */
public class MyRecusion1 {

    public static void main(String[] args) {
        int num = 8;
        int result = count(1,num);
        System.out.println(result);

    }

    private static int count(int n, int max) {
        if(n == max){
            return n;
        }
        return count(n+1,max) * n;
    }


}
